#ifndef DATABASE_DATA_ELEMENT_MAKER_H
#define DATABASE_DATA_ELEMENT_MAKER_H

#include <memory>
#include <vector>

#include "data_element.h"

namespace Database
{

// Внимание! DataElement становится владельцем элемента.
DataElementPtr wrapAnElement(Elements::Element* element);

DataElementPtr wrapAnSharedElement(Elements::ElementPtr element);

DataElementPtr fromDatabase(
    sqlite::database& database,
    Elements::ElementType elementType,
    unsigned id
);

DataElements fromDatabase(
    sqlite::database& database,
    Elements::ElementType elementType,
    const std::vector<unsigned>& ids
);

std::vector<unsigned> fromDatabaseIds(
    sqlite::database& database,
    Elements::ElementType elementType
);

void removeFromDatabase(
    sqlite::database& database,
    Elements::ElementType elementType,
    const std::vector<unsigned>& ids
);

} // namespace Database

#endif // DATABASE_DATA_ELEMENT_MAKER_H
